<% if (props.stylingPackage?.name === "nativewind") { %>
  import '../global.css';
<% } else if (props.stylingPackage?.name === "nativewinui") { %>
  import '../global.css';
  import 'expo-dev-client';
<% } else if (props.stylingPackage?.name === "unistyles") { %>
  import { useUnistyles } from "react-native-unistyles";
<% } %>
<% if (props.internalizationPackage?.name === "i18next") { %>
  import '../translation';
<% } %>
	import { Stack } from "expo-router";

<% if (props.analyticsPackage?.name === "vexo-analytics") { %>
  import { vexo } from 'vexo-analytics';

  vexo(process.env.EXPO_PUBLIC_VEXO_API_KEY);
<% } %>

export const unstable_settings = {
	// Ensure that reloading on `/modal` keeps a back button present.
	initialRouteName: "(tabs)",
};

export default function RootLayout() {
  <% if (props.stylingPackage?.name === "unistyles") { %>
    const { theme } = useUnistyles();
  <% } %>

  return (
        <% if (props.stylingPackage?.name === "unistyles") { %>
            <Stack
                screenOptions={{
                    headerStyle: {
                        backgroundColor: theme.colors.background,
                    },
                    headerTitleStyle: {
                        color: theme.colors.typography,
                    },
                    headerTintColor: theme.colors.typography
                }}
            >
        <% } else  { %>
            <Stack>
        <% } %>
		<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
		<Stack.Screen name="modal" options={{ presentation: "modal" }} />
	</Stack>
  );
}
